<html>
<head>
	<title>Table(Matrix)</title>
</head>
<body>
<table border ="1">
<?php

$arr = array(
		array("ID" => 1,
				"Name" => "Ivan",
				"Age" => 15,
				"Gender" => "M"),
		array("ID" => 2,
				"Name" => "Mariika",
				"Age" => 16,
				"Gender" => "F")
		);

echo "<tr>";
foreach($arr[0] as $key => $value)
{
	echo"<td>$key</td>";
}
echo "</tr>";

for($i = 0; $i < count($arr); $i++)
{
	$current = $arr[$i];
	
	echo "<tr>";
	//echo "<td>".$arr[$i]['ID']."</td>";
	echo "<td>".$current['ID']."</td>";
	echo "<td>".$current['Name']."</td>";
	echo "<td>".$current['Age']."</td>";
	echo "<td>".$current['Gender']."</td>";
	echo "</tr>";
}

?>
</table>
</body>

</html>